public class Test {

    public static void main(String[] args) {
        try {
            MyArrayList myArrayList = new MyArrayList();
            myArrayList.add(1);
            myArrayList.add(2);
            myArrayList.add(3);
            myArrayList.add(4);
            myArrayList.add(5);
            int ele = myArrayList.get(2);
            System.out.println(ele);

            boolean ret = myArrayList.contains(5);
            System.out.println(ret);

            myArrayList.set(2, 100);
            myArrayList.remove(1);
            myArrayList.display();
        } catch (ErrorPosException e){
            e.printStackTrace();
        }catch (EmptyListException e) {
            e.printStackTrace();
        }
    }

    public static void main1(String[] args) {
        try {
            MyArrayList myArrayList = new MyArrayList();
            myArrayList.add(1);
            myArrayList.add(2);
            myArrayList.add(3);
            myArrayList.add(4);
            myArrayList.add(5);

            myArrayList.add(2, 100);

            myArrayList.display();
        }catch (EmptyListException e){
            e.printStackTrace();
        }catch (ErrorPosException e){
            e.printStackTrace();
        }
    }
}
